home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / rhstdlib.arc / SHELL.A < prev    next >
Encoding:
Text File  |  1990-10-20  |  1.1 KB  |  54 lines

  1. cseg        segment    para public 'code'
  2.         assume    cs:cseg, ds:dseg
  3. ;
  4.         include    stdlib.a
  5. ;
  6. ;
  7. ; Variables that wind up being used by the standard library routines.
  8. ; The MemInit routine uses "PSP" and "zzzzzzseg" labels.  They must be
  9. ; present if you intend to use getenv, MemInit, malloc, and free.
  10. ;
  11. ;
  12.         public    PSP
  13. PSP        dw    ?
  14. ;
  15. ;
  16. ;
  17. ; Main is the main program.  Program execution always begins here.
  18. ;
  19. Main        proc
  20.         mov    cs:PSP, es        ;Save pgm seg prefix
  21.         mov    ax, seg dseg        ;Set up the segment registers
  22.         mov    ds, ax
  23.         mov    es, ax
  24.         MemInit                ;Initialize Memory Manager
  25. ;
  26. Quit:        mov     ah, 4ch
  27.         int     21h
  28. ;
  29. ;
  30. Main        endp
  31. cseg            ends
  32. ;
  33. ;
  34. ; Normally, you should allocate global variables in DSEG:
  35. ;
  36. dseg        segment    para public 'data'
  37. dseg        ends
  38. ;
  39. ;
  40. ; Allocate a reasonable amount of space for the stack (2k).
  41. ;
  42. sseg        segment    para stack 'stack'
  43. stk        db    256 dup ("stack   ")
  44. sseg        ends
  45. ;
  46. ;
  47. ;
  48. ; zzzzzzseg must be the last segment that gets loaded into memory!
  49. ;
  50. zzzzzzseg    segment    para public 'zzzzzz'
  51. LastBytes    db    16 dup (?)
  52. zseg        ends
  53.         end    Main
  54.